<!doctype html>
<!--
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<html>
<head>
  <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
  <title>shop-home</title>

  <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <script src="../bower_components/web-component-tester/browser.js"></script>

  <!-- Import the element to test -->
  <link rel="import" href="../src/shop-home.html">

</head>
<body>

  <test-fixture id="basic">
    <template>
       <shop-home></shop-home>
    </template>
  </test-fixture>

  <script>
    suite('shop-home tests', function() {
      var home;

      setup(function() {
        home = fixture('basic');
      });

      test('Item lengths should be equalled', function(done) {
        // Test categories property
        home.categories = [
          {name: 'furniture', title: 'Furniture'},
          {name: 'food', title: 'Food'},
          {name: 'fashion', title: 'Fashion'}
        ];

        // Data bindings will stamp out new DOM asynchronously
        // so wait to check for updates
        flush(function() {
          var items = Polymer.dom(home.root).querySelectorAll('.item');
          assert.equal(home.categories.length, items.length);
          done();
        });
      })
    });
  </script>

</body>
</html>
